﻿using KAKA.Domain;
using Morus.Infrastructure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace KAKA.Repository.Specification
{
    public class VipMemberSpecification : Specification<Member>
    {
        public VipMemberSpecification(Gender gender)
        {
            Gender = gender;
        }

        public Gender Gender { get; private set; }

        public override Expression<Func<Member, bool>> Expression
        {
            get
            {
                return Eval(r => ((r.Grade | Grade.VIP1) == Grade.VIP1) && r.Gender == Gender).Expression;
            }
        }
    }
}
